﻿<%@ Page Language="C#" AutoEventWireup="true"  title="管理员组管理" masterpagefile="~/Admin/Main.master" CodeFile="ManagerRole.aspx.cs" Inherits="Admin_ManagerRole" %>

<%@ Register TagPrefix="uc" TagName="ContentMenu" Src="~/Admin/ContentMenu.ascx"%>
<asp:Content ID="Content1" ContentPlaceHolderID="LeftMenu" Runat="Server">
    <div class="leftMenuTitle">
        安全设置
    </div>
    <ul class="leftMenu">
        <li><a href="ChangeMyInformation.aspx">我的资料</a></li>
        <li><a href="ManagerAdd.aspx">管理员管理</a></li>
        <li><a href="SysLog.aspx">系统日志</a></li>
    </ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MidContent" Runat="Server">
  <div id="mainMenu">
  	<ul>
		<li><a href="ManagerAdd.aspx">添加管理员</a></li>
		<li><a href="ManagerList.aspx">管理员列表</a></li>
		<li><a href="ManagerRole.aspx">管理员组</a></li>
		<li><a href="ManagerRoleEdit.aspx">组权限定义</a></li>
	</ul>
  </div>
   <div id="main">
   <asp:Label id="Msg" runat="server" Text="" CssClass="msg" Visible="False"></asp:Label>
    <asp:GridView ID="ManagerRoleList" runat="server" AllowPaging="True" AutoGenerateColumns="False" OnPageIndexChanging="ManagerRoleList_PageIndexChanging" DataKeyNames="RoleId" OnRowEditing="ManagerRoleList_RowEditing" OnRowUpdating="ManagerRoleList_RowUpdating" PageSize="11" OnRowDeleting="ManagerRoleList_RowDeleting" CellPadding="0" CssClass="gv" Width="100%" OnRowDataBound="ManagerRoleList_RowDataBound" >
        <Columns>
            <asp:BoundField DataField="RoleId" HeaderText="Id" ReadOnly="True" SortExpression="RoleId" />
            <asp:TemplateField HeaderText="组名称">
                <EditItemTemplate>
                    <asp:TextBox ID="ClassName" runat="server" Text='<%# Bind("ClassName") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("Title") %>'></asp:Label>&nbsp;
                </ItemTemplate>
                <ItemStyle CssClass="gvLeftField" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="添加时间">
                <ItemTemplate>
                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("AddTime") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                <EditItemTemplate>
                    <asp:Button ID="UpdateBt" runat="server" CausesValidation="True" CommandName="Update"
                        Text="更新" />
                    <asp:Button ID="CancelBt" runat="server" CausesValidation="False" CommandName="Cancel"
                        Text="取消" />    
                </EditItemTemplate>
                <ItemStyle CssClass="gvCommandField" />
                <ItemTemplate>
                    &nbsp;<asp:Button ID="DelBt" runat="server" CausesValidation="False" CommandName="Delete" Text="删除" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="设置权限">
                <ItemStyle CssClass="gvBtAField" />
                <ItemTemplate>
                    <asp:HyperLink ID="EditHyperLink" runat="server" NavigateUrl='<%# Eval("RoleId", "ManagerRoleEdit.aspx?RoleId={0}") %>'
                        Text="设置权限"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <RowStyle CssClass="gvRow" />
        <EditRowStyle CssClass="gvEditRow" />
        <PagerStyle CssClass="gvPage" />
        <HeaderStyle CssClass="gvHeader" />
        <AlternatingRowStyle CssClass="gvAlternatingRow" />
    </asp:GridView>
    <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D7D7D7" id="mainBottTable">
      <tr>
        <td colspan="3" bgcolor="#FFFFFF" class="mainTitle">
            添加管理员组</td>
      </tr>
      <tr>
        <td align="right" bgcolor="#FFFFFF"  >
            管理组名称:</td>
          <td bgcolor="#FFFFFF">&nbsp;<asp:TextBox ID="RoleTitle" runat="server" CssClass="inputText"></asp:TextBox>
              <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="RoleTitle"
                  Display="Dynamic" ErrorMessage="必须填写" ValidationGroup="ClassAdd"></asp:RequiredFieldValidator>
              <asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="RoleTitle"
                  ErrorMessage="已经存在此会员组" OnServerValidate="CustomValidator1_ServerValidate1" ValidationGroup="ClassAdd"></asp:CustomValidator></td>
          <td bgcolor="#ffffff">
              <asp:Button ID="AddClass" runat="server" CssClass="inputBt" Text="添加组" OnClick="AddClass_Click" ValidationGroup="ClassAdd" /></td>
      </tr>
    </table>

  </div>
  <script language="JavaScript" type="text/javascript" >
        topMenuThisPage(4);//当前位置顶部菜单标识
        leftMenuThisPage(1,2);//当前位置左侧菜单标识
        mainMenuThisPage(3);//当前选项卡标识
  </script>
</asp:Content>
